<?php
class ControllerModuleBannerTextAd extends Controller {
	public function index($setting) {
		static $module = 0;

		$this->load->model('tool/image');

		if (is_file(DIR_IMAGE . $setting['image'])) {
			$image = $setting['image'];
		} else {
			$image = 'placeholder.png';
		}

		$data['image'] = $this->model_tool_image->resize($image, $setting['width'], $setting['height']);

		$data['title'] = $setting['title'];
		$data['text'] = $setting['text'];
		$data['button'] = $setting['button'];
		$data['href'] = $setting['href'];

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/banner_text_ad.tpl')) {
			return $this->load->view($this->config->get('config_template') . '/template/module/banner_text_ad.tpl', $data);
		} else {
			return $this->load->view('default/template/module/banner_text_ad.tpl', $data);
		}
	}
}